﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using EPiServer.Data.Dynamic;

namespace FilteredPageReference
{
    using System.Web;
    using System.Web.Hosting;
    using EPiServer;
    using EPiServer.PlugIn;

    /// <summary>
    /// Register resource class
    /// </summary>
    internal class RegisterResources : PlugInAttribute
    {

        #region Static methods

        /// <summary>
        /// Initialises VPP mappings
        /// </summary>
        public static void Start()
        {
            RegisterVppResources();
        }

        /// <summary>
        /// Registers Vpp resources
        /// </summary>
        private static void RegisterVppResources()
        {
            if (HttpContext.Current == null)
                return;

            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/util/FilteredPageReference/PageBrowserFilteredPageReference.aspx", "FilteredPageReference.Pages.PageBrowserFilteredPageReference.aspx", false));
            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/util/FilteredPageReference/PageExplorerFilteredPageReference.ascx", "FilteredPageReference.UserControls.PageExplorerFilteredPageReference.ascx", false));
            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/util/FilteredPageReference/PropertyLinkCollectionFilteredPageReferenceEditControl.ascx", "FilteredPageReference.UserControls.PropertyLinkCollectionFilteredPageReferenceEditControl.ascx", false));
            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/util/FilteredPageReference/HyperLinkPropertiesFilteredPageReference.aspx", "FilteredPageReference.Pages.HyperlinkPropertiesFilteredPageReference.aspx", false));
        }

        #endregion Static methods

    }
}
